var t = getApp();

Page({
    data: {
        show: "",
        company: {},
        person: {},
        noIdentify: !1
    },
    onLoad: function(t) {
        var a = t.show;
        this.setNavigationBar(a), this.setData({
            show: a
        }), this.timer && clearInterval(this.timer), "company" === a ? this.getCompanyData() : this.getPersonData();
    },
    setNavigationBar: function(t) {
        "person" == t ? wx.setNavigationBarTitle({
            title: "个人认证结果"
        }) : wx.setNavigationBarTitle({
            title: "企业认证结果"
        });
    },
    toSign: function(t) {
        var a = "", e = "", n = t.target.dataset;
        n.str && (a = n.str), console.log(n), e = 1 == a ? "/packageH/signPage/signCompany/signCompany" : "home" == a ? "/packageH/signPage/contractList/contractList" : "/packageH/signPage/personBank/personBank", 
        wx.redirectTo({
            url: e
        });
    },
    getPersonData: function() {
        var a = this, e = t.getNetAddresss("plugin.yun-sign.frontend.h5.person.check-person-approve");
        t._getNetWork({
            url: e,
            success: function(e) {
                var n = e.data;
                1 === n.result ? a.setData({
                    person: n.data
                }) : (a.setData({
                    noIdentify: !0
                }), t.tips(n.msg));
            }
        });
    },
    getCompanyData: function() {
        var a = this, e = t.getNetAddresss("plugin.yun-sign.frontend.company.check-company-approve");
        t._getNetWork({
            url: e,
            success: function(t) {
                var e = this, n = t.data;
                1 === n.result && (a.setData({
                    company: n.data,
                    status: n.data.status
                }), "NO_INIT" == a.data.status ? a.timer && clearInterval(a.timer) : "ING" == a.data.status ? a.timer || (a.timer = setInterval(function() {
                    e.getCompanyData();
                }, 3e4)) : (a.timer && clearInterval(a.timer), setTimeout(function() {
                    wx.redirectTo({
                        url: "/packageH/signPage/contractList/contractList"
                    });
                }, 3e3)));
            },
            fial: function(t) {
                console.log(t, "-------err--------");
            }
        });
    },
    freeTell: function() {
        wx.makePhoneCall({
            phoneNumber: "0755-66635068"
        });
    }
});